package com.dengyuanke.entity.enums;

import com.baomidou.mybatisplus.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;

import java.io.Serializable;

/**
 * Created by dengyuanke on 2017/11/7.
 */
public enum  UnitEnum implements IEnum{

    HOUR("H", "小时"),
    DAY("D", "天"),
    WEEK("W", "周"),
    MONTH("M", "月");

    private String flag;
    private String desc;

    UnitEnum(String flag, String desc) {
        this.flag = flag;
        this.desc = desc;
    }

    @Override
    public Serializable getValue() {
        return this.flag;
    }
    @JsonValue
    public String getDesc(){
        return this.desc;
    }
}
